package com.hoaptt.pieces;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



import com.hoaptt.helper.Coordinate;
import com.hoaptt.model.Board;
import java.util.ArrayList;

/**
 *
 * @author ThuHoa
 */
// Advisor: Si
public class Advisor extends Piece{

    public Advisor(PLAYER player) {
        super(player);
        this.nameA = Character.toString((char)20181);
        this.nameB = Character.toString((char)22763);
        this.alias = NAMEPIECE.advisor;
    }

    @Override
    public ArrayList<Coordinate> generateMove(Board board, Coordinate loc) {
         ArrayList<Coordinate> array = new ArrayList<Coordinate>();
         //array.add(new Coordinate(3, 2) );
         int X[] = new int[]{ 1,  1, -1, -1};
         int Y[] = new int[]{ 1, -1,  1, -1};
         for (int i=0; i<X.length; i++){
             Coordinate coo = new Coordinate(loc.getRow()+X[i], loc.getCol() +Y[i]);
             if ((coo.getRow()>=3 && coo.getRow()<=5) && (coo.getCol()<=2 || coo.getCol()>=7)) {
                  System.out.println("coodinatr: " +coo.getRow() +"\t" +coo.getCol());
                 array.add(coo);
             }
         }

         System.out.println("Size :" + array.size());
        return array;
    }




}
